<h1>Listing members</h1>

<table>
  <tr>
  <% for column in Member.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>
	<th>Status</th>
  </tr>
  
<% for member in @members %>
  <tr>
  <% for column in Member.content_columns %>
    <td><%=h member.send(column.name) %></td>
  <% end %>
	<td>
		<%= member.member_status.name %>
	</td>
    <td><%= link_to 'Show', :action => 'show', :id => member %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => member %></td>
	<% if @i.can_edit_permissions == 1 %>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => member }, :confirm => 'Are you sure?', :post => true %></td>
	<% end %>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @member_pages.current.previous } if @member_pages.current.previous %>
<%= link_to 'Next page', { :page => @member_pages.current.next } if @member_pages.current.next %> 

<br />

<p id="new_member">
<%= link_to 'New member', :action => 'new' %>
</p>

<p id="back">
<%= link_to 'Back', :controller => 'command', :action => 'index' %>
</p>